﻿using System.Windows;
using System.Windows.Media;
using AzukiMap.Map;
using GeoAPI.Geometries;

namespace AzukiMap.Element
{
    public class Label
    {
        private const string DEFAULT_FONT = "Arial";
        private const double DEFAULT_FONTSIZE = 10.5;
        private readonly Color _defaultBgcolor = Colors.White;
        private readonly Color _defaultColor = Colors.Black;
        private const double BACKGROUND_OFFSET_X = 1;
        private const double BACKGROUND_OFFSET_Y = 1;

        public int Id { get; set; }

        public IGeometry Geom { get; set; }

        public string Text { get; set; }

        public HorizontalAlignment HorizontalAlignment { get; set; }

        public VerticalAlignment VerticalAlignment { get; set; }

        public Thickness Margin { get; set; }

        public FontFamily Font { get; set; }

        public Brush Foreground { get; set; }

        public double FontSize { get; set; }

        public FontWeight FontWeight { get; set; }

        public bool NeedsBackground { get; set; }

        public Brush Background { get; set; }

        public FontWeight BackgroundFontWeight { get; set; }

        public double BackgroundOffsetX { get; set; }

        public double BackgroundOffsetY { get; set; }

        public Label()
        {
            Font = new FontFamily(DEFAULT_FONT);
            FontSize = DEFAULT_FONTSIZE;
            Foreground = new SolidColorBrush(_defaultColor);
            Background = new SolidColorBrush(_defaultBgcolor);
            FontWeight = FontWeights.Normal;
            BackgroundOffsetX = BACKGROUND_OFFSET_X;
            BackgroundOffsetY = BACKGROUND_OFFSET_Y;
            BackgroundFontWeight = FontWeights.SemiBold;
            NeedsBackground = false;
        }
    }
}